#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const int MX = 49;

int n, m;
ll p[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) {
    ll x;
    cin >> x;
    per(j, MX, 0) {
      if (x >> j) {
        if (p[j])
          x ^= p[j];
        else {
          p[j] = x;
          break;
        }
      }
    }
  }
  ll ans = 0;
  per(i, MX, 0) { ans = max(ans, ans ^ p[i]); }
  cout << ans;
  return 0;
}